<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <script type="text/javascript">

        function OnPageOfficeCtrlInit() {
            pageofficectrl.CustomToolbar = false;
        }
        //套红
        function taoHong() {
            var mb = document.getElementById("templateName").value;
            if (pageofficectrl.IsDirty) {
                var flag = confirm("正文已被修改，如果继续套红会导致刚编辑的内容丢失，是否继续套红？")
                if (flag) {
                    document.getElementById("form1").action = "taoHong?mb=" + mb;
                    document.forms[0].submit();
                } else {
                    return false;
                }
            }
            document.getElementById("form1").action = "taoHong?mb=" + mb;
            document.forms[0].submit();

        }

        //保存并关闭
        function saveAndClose() {

            pageofficectrl.WebSave();
            pageofficectrl.CloseWindow();
        }

        function setEnabled(flag) {
            pageofficectrl.Enabled = flag;
        }

        function selectOptionBlur(select) {
            select.blur();
        }
    </script>
</head>

<div id="content">
    <div id="textcontent" style="width: 1000px; height: 800px;">
        <div class="flow4">
            <form method="post" id="form1">
                <strong>模板列表：</strong>
                <span style="color: Red;"> <select name="templateName"
                                                   id="templateName" style='width: 240px;' onchange="selectOptionBlur(this)" onfocus="setEnabled(false)" onblur="setEnabled(true)">
								<option value='temp2008.doc' selected="selected">
									模板一
								</option>
								<option value='temp2009.doc'>
									模板二
								</option>
								<option value='temp2010.doc'>
									模板三
								</option>
							</select> </span>
                <span style="color: Red;"><input type="button" value="一键套红"
                                                 onclick="taoHong()"/> </span>
                <span style="color: Red;"><input type="button" value="保存关闭"
                                                 onclick="saveAndClose()"/> </span>
            </form>
        </div>
        <div style=" width:auto; height:700px;" th:utext="${pageoffice}">
        </div>


    </div>
</div>
<div id="footer">
    <hr width="1000"/>
    <div>
        Copyright (c) 2012 北京卓正志远软件有限公司
    </div>
</div>
</body>
</html>
